package com.fengxu.springcloud.service;

import feign.hystrix.FallbackFactory;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Component;

/**
*@Description 设置服务降级的方法
*@Author 风珝
*@Date 2021/1/15 22:47
*@Version 1.0.0
*/
@Component
@Log4j2
public class PaymentHystrixServiceFallBackFactory implements FallbackFactory<PaymentHystrixService> {
    @Override
    public PaymentHystrixService create(Throwable throwable) {
        log.warn(throwable);
        return new PaymentHystrixServiceFallBack();
    }
}
